/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import React from 'react';
import type { FormInstance } from 'antd';
import { Form } from 'antd';
import { ProFormRadio } from '@ant-design/pro-form';
import dayjs from 'dayjs';

/**
 * 导出模块
 *  */
const ExportContent: React.FC<{ form: FormInstance }> = ({ form }) => {
  const thisMonth = dayjs().format('YYYY-MM');
  const lastMonth = dayjs().add(-1, 'month').startOf('month').format('YYYY-MM');

  return (
    <Form
      form={form}
      initialValues={{
        time: lastMonth,
      }}
    >
      <ProFormRadio.Group
        name='time'
        radioType='button'
        options={[
          {
            label: lastMonth,
            value: lastMonth,
          },
          {
            label: thisMonth,
            value: thisMonth,
          },
        ]}
      />
    </Form>
  );
};

export default ExportContent;
